
#ifndef VARIANTBOX_H
#define VARIANTBOX_H

#include <BLabel>
#include <BCheckBox>
#include <BLineEdit>
#include <BSpinBox>
#include <BLongSpinBox>
#include <BFloatSpinBox>
#include <BDoubleSpinBox>
#include <BVariant>

using namespace BWE;

class VariantBox : public BWidget
{
public:
	VariantBox(BWidget* parent = 0);
	~VariantBox();

	void setType(const BString& type);
	const BString& type() const;

	void setVariant(const BVariant& variant);
	const BVariant& variant() const;

protected:
	void slotNameChanged(BObject* object, const BValue& value);
	void slotBoolChecked(BObject* object, const BValue& value);
	void slotIntValueChanged(BObject* object, const BValue& value);
	void slotLongValueChanged(BObject* object, const BValue& value);
	void slotFloatValueChanged(BObject* object, const BValue& value);
	void slotDoubleValueChanged(BObject* object, const BValue& value);
	void slotStringEditFinished(BObject* object, const BValue& value);

private:
	BVariant				_variant;
	BHolder<BSpinBox>		_intSpinBox;
	BHolder<BLongSpinBox>	_longSpinBox;
	BHolder<BFloatSpinBox>	_floatSpinBox;
	BHolder<BDoubleSpinBox>	_doubleSpinBox;
	BHolder<BLineEdit>		_stringLineEdit;
	BHolder<BCheckBox>		_boolCheckBox;
};

#endif
